@extends('edu::layouts.member')

@section('content')
    <div id="app" class="card shadow-sm">
        <div class="card">
            <div class="card-header bg-white">
                站内消息
            </div>
            <div class="card-body">

                @if($notifications->count()>0)
                    <table class="table">
                        <thead>
                        <th>消息</th>
                        <th>发布时间</th>
                        <th width="120"></th>
                        </thead>
                        <tbody>
                        @foreach($notifications as $notification)
                            <tr>
                                <td>{{$notification['data']['title']}}</td>
                                <td>{{$notification['created_at']}}</td>
                                <td>
                                    <div class="btn-group btn-group-sm">
                                        <a href="{{route('edu.member.message.show',$notification['id'])}}"
                                           class="btn btn-info">查看</a>
                                        <btn-del
                                            action="{{route('edu.member.message.destroy',$notification['id'])}}"></btn-del>
                                    </div>
                                </td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                @else
                    @include('edu::layouts.nothingTips',['content'=>'暂无任何消息'])
                @endif
            </div>
            <div class="card-footer text-muted">
                @include('edu::layouts.paginate',['data'=>$notifications])
            </div>
        </div>
    </div>
@endsection
